#include <iostream>
#include <string>
using namespace std;

struct student
{
    /* data */
    string name;
    int age;
    int score;
};
struct teacher
{
    /* data */
    string name;
    student s[2];
};

void inputStudent(student *s)
{
    cout << "请输入学生的姓名" << endl;
    cin >> s->name;
    cout << "请输入学生的年龄" << endl;
    cin >> s->age;
    cout << "请输入学生的分数" << endl;
    cin >> s->score;
}

void inputInformation(teacher *t)
{
    cout << "请输入老师的名字" << endl;
    cin >> t->name;
    for (int i = 0; i < 2; i++)
    {
        /* code */
        inputStudent(&t->s[i]);
    }
}

int main()
{
    teacher T[3];
    // 一次输入每个老师的名字即所带的学生的信息
    for (int i = 0; i < 3; i++)
    {
        /* code */
        inputInformation(&T[i]);
    }

    // 输出老师学生的信息
    for (int i = 0; i < 3; i++)
    {
        /* code */
        cout << "老师的名字是" << T[i].name << endl;
        cout << "他带的学生是" << endl;
        for (int j = 0; j < 2; j++)
        {
            /* code */
            cout << "第" << j << "个学生" << T[i].s[j].name << "\t" << T[i].s[j].age << "\t" << T[i].s[j].score << endl;
        }
    }

    return 0;
}
